package com.zttek.videoShareProject.modules.web;
import com.zttek.videoShareProject.common.base.MyBaseController;
import com.zttek.videoShareProject.common.json.AbuseVO;
import com.zttek.videoShareProject.modules.model.Abuse;
import com.zttek.videoShareProject.modules.service.IAbuseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.Date;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author CBY
 * @since 2018-07-03
 */
@Controller
@RequestMapping("/abuse")
public class AbuseController extends MyBaseController{
	@Autowired
    private IAbuseService abuseService;


    @RequestMapping(value = "add_abuse",method = RequestMethod.POST)
    @ResponseBody
    public Object addAbuse(@RequestBody AbuseVO.AddAbuse addAbuse){
        Abuse abuse=addAbuse.getAbuse();
        try {
            abuseService.addAbuse(abuse);
        }catch (Exception e){
            e.printStackTrace();
            renderError();
        }
        return renderSuccess();
    }
}
